package round91;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String str = in.readLine();
        int f = 0, s = 0;
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if(c == '4')
                f++;
            else if(c == '7')
                s++;
        }
        if(f == 0 && s == 0)
            System.out.println(-1);
        else if(f >= s)
            System.out.println(4);
        else
            System.out.println(7);
    }
}
